package lanQiao;

import java.util.*;

public class NumPractice
{
	public static void main(String[] args)
	{
		Scanner s = new Scanner(System.in);
		int min=10000,max=-10000,sum=0;

		for(int i=s.nextInt(); i>0; i--)
		{
			int t=s.nextInt();
			if(min>t)min=t;
			if(max<t)max=t;
			sum+=t;
		}
		System.out.println(max+"\n"+min+"\n"+sum);
	}
}
